###

The Store holds values for the listview. 

###

tree.ui.TYPES = {
    string: 1, 
    number: 2, 
    image:  3,
    radio:  4,
    object: 5
}


###
var s = new Store(
{
    title: TYPES.string,
    
});

Stores are used to store data for the listview.
You have to specify the types of the columns first.
After creating the widgets, you can add elements by using tree.ui.Store.append:

s.append(['string number one']);

You can access elements by using tree.ui.Store.index:

s.index(0);

events: ['changed']

###

class tree.ui.Store extends tree.BaseObject
    constructor: (columns) ->
        super
        @model = columns
        @len = 0
        for  field of columns
            @len += 1
        
        @values = []
        @length = 0
    
    ###
    append values, the values must be in an array, also if the store contains just one element
    ###
    append: (value) ->
        if value.length != @len
            throw new TypeError  'invalid length for liststore'
        
        else
            @length += 1
            @values.push value
            @emit 'changed', {}
        
    ###
    access rows by their index
    ###
    index: (i) ->
        @values[i]
    
    get_values: () ->
        @values
    
    get_model: () ->
        @model
